package com.sip.interphone.exception;

/**
 * 自定义；业务服务异常
 */
public class ServiceException extends RuntimeException {
    /**
     * 错误提示
     */
    private String message;
    /**
     * 错误明细，内部调试错误
     */
    private String detailMessage;

    public ServiceException() {
    }

    public ServiceException(String message) {
        this.message = message;
    }

    public ServiceException(String message, String detailMessage) {
        this.message = message;
        this.detailMessage = detailMessage;
    }


    public ServiceException setMessage(String message) {
        this.message = message;
        return this;
    }

    // 重写父级的错误消息，读取当前自定义消息
    @Override
    public String getMessage(){
        return this.message;
    }

    public String getDetailMessage() {
        return detailMessage;
    }

    public ServiceException setDetailMessage(String detailMessage) {
        this.detailMessage = detailMessage;
        return this;
    }

}
